package com.weijianhuawen.wjblog.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @version: java version 8
 * @Author: weijianhuawen
 * @description:
 * @date: 2024-12-24 22:06
 */

@Getter
@AllArgsConstructor
public enum UserAccountStatusEnum {
    // 正常状态
    ACCOUNT_NORMAL(0, "正常"),
    ACCOUNT_RESTRICT(1, "禁言"),
    ACCOUNT_SUSPENSION(2, "封禁"),
    ;


    private Integer code;
    private String description;

    public static UserAccountStatusEnum getEnumByCode(Integer code) {
        for (UserAccountStatusEnum value : UserAccountStatusEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
